//
// Created by Administrator on 2024/3/26.
//
#include<bits/stdc++.h>

using namespace std;

int main() {
    vector<int> a(4, 0);
    while (cin >> a[0] >> a[1] >> a[2] >> a[3]) {
        sort(a.begin(), a.end());
        cout << a[3] * (a[2] * 100 + a[1] * 10 + a[0]) << endl;
    }

    return 0;
}
